<?php
	require "settings/config.php";
	require "layout.php";
	require "includes/sql_functions.php";
	require "includes/reg_functions.php";
	require "includes/session.php";
	
	if($_POST['newpass'])
	{
		if($_POST['newpass'] != $_POST['newpass2'])
		{
			header("Location: settings.php?mismatch=1");
		}
		if (oh_validate_pass($_POST['oldpass']) == TRUE)
		{
			oh_update_pass($_POST['newpass']);
			header("Location: settings.php?passchanged=1");
		}
		else
		{
			header("Location: settings.php?badpass=1");
		}
	}

?>
